package com.neusoft.controller.inspection;

import com.neusoft.service.InspectionRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.List;
@RestController
@CrossOrigin
@RequestMapping("/inspection")
public class InspectionRequestController {
    @Autowired
    InspectionRequestService inspectionRequestService;
    @GetMapping("/getFinishInspection")
    public Integer getFinishInspection(){
        Integer finishCheck = inspectionRequestService.getFinishInspection();
        return finishCheck;
    }
    @GetMapping("/getWaitRegisterIdList")
    public List<Integer> getWaitRegisterIdList(){
        List<Integer> registerIdList = inspectionRequestService.getWaitRegisterIdList();
        return registerIdList;
    }
    @PutMapping("/updateInspectionRequestTable")
    public void updateInspectionRequestTable(Integer inspectionId, Integer employeeId){
        inspectionRequestService.updateInspectionRequestTable(inspectionId,employeeId);
    }
    @GetMapping("/searchInspection")
    public List<Map<String,Object>> searchInspection(@RequestParam Integer registerId) {
        return inspectionRequestService.searchInspectionItems(registerId);
    }
}
